home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / messages / src / getmsg.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.3 KB  |  67 lines

  1. /*
  2.     $Id$
  3.     $Log$
  4.     Desc:
  5.     Lang: english
  6. */
  7. #include "exec_intern.h"
  8. #include <exec/ports.h>
  9.  
  10. /*****************************************************************************
  11.  
  12.     NAME */
  13.     #include <clib/exec_protos.h>
  14.  
  15.     __AROS_LH1(struct Message *, GetMsg,
  16.  
  17. /*  SYNOPSIS */
  18.     __AROS_LA(struct MsgPort *, port, A0),
  19.  
  20. /*  LOCATION */
  21.     struct ExecBase *, SysBase, 62, Exec)
  22.  
  23. /*  FUNCTION
  24.     Get a message from a given messageport. This function doesn't wait
  25.     and returns NULL if the messageport is empty. Therefore it's
  26.     generally a good idea to WaitPort() or Wait() on the given port first.
  27.  
  28.     INPUTS
  29.     port - Pointer to messageport
  30.  
  31.     RESULT
  32.     Pointer to message removed from the port.
  33.  
  34.     NOTES
  35.  
  36.     EXAMPLE
  37.  
  38.     BUGS
  39.  
  40.     SEE ALSO
  41.     WaitPort(), PutMsg()
  42.  
  43.     INTERNALS
  44.  
  45.     HISTORY
  46.     29-10-95    digulla automatically created from
  47.                 exec_lib.fd and clib/exec_protos.h
  48.     17-12-95    digulla Incorporated code by Matthias Fleischner
  49.  
  50. *****************************************************************************/
  51. {
  52.     __AROS_FUNC_INIT
  53.     struct Message *msg;
  54.  
  55.     /* Protect the message list. */
  56.     Disable();
  57.  
  58.     /* Get first node. */
  59.     msg=(struct Message *)RemHead(&port->mp_MsgList);
  60.  
  61.     /* All done. */
  62.     Enable();
  63.  
  64.     return msg;
  65.     __AROS_FUNC_EXIT
  66. } /* GetMsg */
  67.